<?php

include '../DB/dbConnection.php';

$result=array();

if ($_POST){
	
	$stmt = $conn->prepare("INSERT INTO contact_us (name, school, email, contact, city, state, subject, message) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
	$stmt->bind_param("ssssssss", $_POST['name'], $_POST['school'], $_POST['email'], $_POST['contact'], $_POST['city'], $_POST['state'], $_POST['subject'], $_POST['message']);
	$success = $stmt->execute();
	$stmt->close();
	$conn->close();
	
	if($success)
		$result['error']='false';
	else
		$result['error']='true';
}
else
{
	$result['error']='true';
}

echo json_encode($result);
?> 